﻿@model Coleotrack.Areas.Admin.Models.UserViewModel
@using Coleotrack.Resources


    @using (Html.BeginForm()) {
        @Html.ValidationSummary(false, labels.ErrorsOccured)
            
            @Html.HiddenFor(x => x.User.Id)

            <br />
            <div class="editor-label required">                
                @Html.LabelFor(x => x.User.Name)
                <p class="description">The name of your user.</p>
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(x => x.User.Name)
            </div>
            
            <br />

            <div class="editor-label required">                
                @Html.LabelFor(x => x.User.Email)
                <p class="description">The email of the user.</p>
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(x => x.User.Email)
            </div>
            
            <br />

            <div class="editor-label required">                
                @Html.LabelFor(x => x.Password)
                <p class="description">The password for user authentication.</p>
            </div>
            <div class="editor-field">
                @Html.PasswordFor(x => x.Password)
            </div>
            
            <br />

            <div class="editor-label required">                
                @Html.LabelFor(x => x.PasswordConfirmation)
                <p class="description">Please confirm the password above.</p>
            </div>
            <div class="editor-field">
                @Html.PasswordFor(x => x.PasswordConfirmation)
            </div>
            
            <br />

            <div class="commands">
                <div class="submit">
                @if (Model.User.Id > 0) { 
                    <input type="submit" value="Edit" />
                 } else { 
                    <input type="submit" value="Create" />
                 } 
                </div>
                
                <div class="cancel">
                    @Html.ActionLink("Cancel", "Index", null, new {@class="cancel"})
                </div>
                </div>
     } 
